package com.lancoo.ccas53.pojo.constant;

/**
 * @ClassName CommonConstants
 * @Description 常量类
 * @Author quin
 * @Date 2022/8/30 15:51
 */
public class CommonConstants {

    private CommonConstants() {
    }

    /**
     * redis 缓存基础平台数据
     */
    public static final String STR_BUILDING_INFO = "BUILDING_";
    public static final String STR_SCHEDULE_HOURS = "SCHEDULE_HOURS_";
    public static final String STR_CURRENT_TERM = "CURRENT_TERM_";
    public static final String SCHEDULE_INFO = "SCHEDULE_INFO_";

    /**
     * 授课类型对应数字
     */
    public static final int LECTURE = 1;
    public static final int EXPERIMENTAL = 2;
    public static final int COMPUTER = 3;
    public static final int OTHER = 4;

    /**
     * 同步教学班导入方式
     */
    public static final String INCREMENT = "增量";
    public static final String COVER = "覆盖";


    /**
     * 数字化 error 枚举
     */
    public static final int NORMAL = 0;
    public static final int NO_DATA = 1;
    public static final int SYSTEM_UNAVAILABLE = 2;
    public static final int AUTHENTICATION_FAILED = 3;
    public static final int PARAMETER_ERROR = 4;
    public static final int EXCEPTION = 5;


    public static final int NOT_DELETED_FLAG = 0;
    public static final int DELETED_FLAG = 1;

    public static final Integer EXIST = 1;

    public static final Integer DELETED = 2;

    public static final Integer ONE = 1;
    public static final Integer TWO = 2;
    public static final Integer THREE = 3;
    public static final Integer FOUR = 4;
    public static final Integer FIVE = 5;

    public static final String RETRY = "retry";
    public static final String YARN = "YARN";


    /**
     * 数字或者字母正则
     */
    public static final String NUMERICAL_LETTER_REGEX = "^\\s{0}|[A-Za-z0-9]+$";

    /**
     * timecode正则
     */
    public static final String TIME_CODE = "^(0[1-9]|1[0-4])(0[1-9]|1[0-9])$";

    /**
     * 小写字母
     */
    public static final String LETTER_REGEX = "^\\s{0}|[a-z]+$";

    /**
     * 字母数字下划线
     */
    public static final String NUMERICAL_LETTER_UNDERLINE_REGEX = "^[a-zA-Z_]([a-zA-Z0-9_]+)?$";

    /**
     * 字母下划线
     */
    public static final String LETTER_UNDERLINE_REGEX = "^[a-zA-Z_]+$";

    /**
     * 字母中文数字
     */
    public static final String NUM_CHINESE_LETTER_REGEX = "^[a-zA-Z0-9\\u4e00-\\u9fa5]+$";


    /**
     * 字母中文数字下划线(下划线位置不限)
     */
    public static final String NUM_CHINESE_LETTER_UNDERLINE_REGEX = "^[a-zA-Z0-9_\\u4e00-\\u9fa5]+$";

    /**
     * 字母中文数字下划线(下划线位置不能在开头和结尾)
     */
    public static final String NUM_CHINESE_LETTER_UNDERLINE_ONLY_REGEX = "^(?!_)(?!.*?_$)[a-zA-Z0-9_\\u4e00-\\u9fa5]+$";


    /**
     * 小写字母数字下划线
     */
    public static final String NUMERICAL_LETTER2_UNDERLINE_REGEX = "^[a-z_]([a-z0-9_]+)?$";

    /**
     * 正整数
     */
    public static final String NON_ZERO_POSITIVE = "^\\s{0}|[0-9]*[1-9][0-9]*$";


    /**
     * 数字 1-99,包含1和99的整数
     */
    public static final String NON_ZERO_POSITIVE_TWO = "^(-1|([1-9]*[0-9]))$";

    /**
     * 数字
     */
    public static final String ZERO_POSITIVE = "^\\d+$";

    /**
     * 不能含有单引号
     */
    public static final String NOSINGLE_QUOTATION_MARK = "^[^']*$";

    /**
     * 验证ip与端口是否符合规范
     */
    public static final String CHECK_IP_PORT = "^(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5]):([0-9]|[1-9]\\d|[1-9]\\d{2}|[1-9]\\d{3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])$";


    public static final String LIMIT_ONE = " limit 1 ";


    public static final String USER_NAME_HEADER = "user";


    public static final String UNIT_B = "B";
    public static final String UNIT_K = "K";
    public static final String UNIT_M = "M";
    public static final String UNIT_G = "G";


    public static final String COMMA = ",";
    public static final String SPOT = ".";
    public static final String UNDERLINE = "-";
    public static final String SLASH = "/";

    /**
     * 正在使用
     */
    public static final Integer IS_USE = 1;

    /**
     * 无用
     */
    public static final Integer NOT_USE = 2;


    /**
     * 项目名称
     */
    public static final String PROJECT_NAME = "isop";


    /**
     * HDFS文件分隔符
     */
    public static final String HDFS_SEPARATOR = "/";


    public static final String ZIP_SUFFIX = ".zip";

    /**
     * 算法结果输出类型
     */
    public static final String RESULT_SINK = "result_sink";

    public static final String DATA = "data";


    /**
     * 水印
     */
    public static final String KAFKA_TIMESTAMP = "TIMESTAMP";
    public static final String KAFKA_TIMESTAMP3 = "TIMESTAMP(3)";
    public static final String KAFKA_BIGINT = "BIGINT";
    public static final String KAFKA_STRING = "STRING";

    public static final String BINGINT10 = "10";
    public static final String BINGINT13 = "13";


}
